import {Component, ReactNode} from 'react'
import React from 'react'
interface Message{
    username:string,
    msg:string,
    age:number,
    change(nu:number):number
}
interface TsState{
    price:number,
    name:string
}
//let App:FC<propType>=(props:propType)
class Hello extends Component<Message>{
    state:TsState={
        price:10.0,
        name:"wang123"
    };
    constructor(props:Message){
        super(props);
        console.log('hello===>props',props);
    }
    public render(): ReactNode {
        return <>
            <h1>Hello Component</h1>
            <div>
                {this.props.username}正在说 {this.props.msg + 10} 
                <button onClick={()=>this.props.change(10)}>change</button>
            </div>
        </>
    }
}

export default Hello;